package com.ftg.learn.util;

import java.util.List;

/**
 * @author 布衣
 */
public class PageEx<T> {
    //当前页数
    private Integer pageNum;

    //每页显示的条数
    private Integer pageSize;

    //总记录数
    private Integer total;

    //总页数
    private Integer totalPage;

    //数据
    private List<T> data;

    public Integer getPageNum() {
        return pageNum;
    }

    public void setPageNum(Integer pageNum) {
        this.pageNum = pageNum;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    }

    public Integer getTotalPage() {
        return this.getTotal() / this.pageSize + (this.getTotal() % this.pageSize == 0 ? 0 : 1);
    }

    public void setTotalPage(Integer totalPage) {
        this.totalPage = totalPage;
    }

    public List<T> getData() {
        return data;
    }

    public void setData(List<T> data) {
        this.data = data;
    }
}
